extends Area2D

var bodys : Array[CharacterBody2D]

func _ready() -> void:
	body_entered.connect(_on_body_enter_event)
	body_exited.connect(_on_body_exited_event)
	
func _on_body_enter_event(body: Node2D) :
	bodys.append(body)

func _on_body_exited_event(body: Node2D) :
	bodys.erase(body)

func _physics_process(delta: float) -> void:
	if bodys.is_empty() : return
	for body in bodys :
		body.velocity.y = -body.gravity*2.0
